package com.itheima.task.job;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @BelongsProject: heima-leadnews
 * @BelongsPackage: com.itheima.task.job
 * @Author: wangjian
 * @CreateTime: 2022-07-07  17:09
 * @Description: TODO
 * @Version: 1.0
 */
@Component
public class HelloJob {

    @Scheduled(cron = "0/5 * * * * ?")
    public void eat(){
        System.out.println("每隔5秒吃一次饭，我想成为一个胖子"+new Date());
    }
}
